Selerix Developer Tools
Convert Before You Insert
Supplemental Information > The Selerix Data Transmittal > Convert Before You Insert

The Selerix transmittal XML is always sent in a carrier XML envelope such as a SAML or SOAP message.  Because both the transmittal and the message envelope are complete XML structures, the Selerix data transmittal XML must first be converted to avoid parsing issues with the XML.

To this end, Selerix requires a simple conversion of the transmittal XML using HTML Entity Codes.  Simply replace the "less than" [<] and "greater than" [>] characters with their respective HTML Entity Codes [&lt;] and [&gt;] before inserting the transmittal into the carrier XML structure.  The C# .NET example below shows one way this may be accomplished.

The sample code below assumes the entire body of the XML stream is contained in a single string called MyXmlStream and uses String.Replace() to convert the strings to HTML Entities:

// Now that the XML stream is contained in a single string, convert the string 
// to use HTML Entities before injecting the XML into the SOAP carrier envelope

MyXmlStream = MyXmlStream.Replace("<", "&lt");  // Replace open tag character
MyXmlStream = MyXmlStream.Replace(">", "&gt");  // Replace close tag character

When BenSelect extracts the transmittal XML from the carrier XML, it first converts the entities back to standard XML before it processes the data.